/** When your routing table is too long, you can split it into small modules **/

import Layout from '@/layout'
import ModuleLayout from '@/layout/module'

const marketingRouter = {
  path: '/marketing',
  component: Layout,
  redirect: '/marketing/promotion',
  name: 'Marketing',
  meta: {
    title: '营销',
    icon: 'el-icon-s-marketing',
    roles: ['admin', 'shop']
  },
  children: [
    {
      path: '/marketing/promotion',
      component: ModuleLayout,
      redirect: '/marketing/promotion/index',
      name: 'MarketingPromotion',
      meta: {
        title: '营销中心',
        icon: 'em-icon-investment'
      },
      children: [
        {
          path: '/marketing/promotion/index',
          component: () => import('@/views/marketing/index'),
          name: 'MarketingPromotionIndex',
          meta: {
            title: '营销插件'
          },
          hidden: true
        },
        {
          path: '/marketing/promotion/seckill',
          component: ModuleLayout,
          name: 'MarketingSeckill',
          redirect: '/marketing/promotion/seckill/index',
          meta: {
            title: '限时秒杀'
          },
          hidden: true,
          children: [
            {
              path: '/marketing/promotion/seckill/index',
              component: () => import('@/views/promotion/seckill/index'),
              name: 'MarketingSeckillIndex',
              meta: {
                title: '限时秒杀'
              },
              hidden: true
            },
            {
              path: '/marketing/promotion/seckill/audit',
              component: () => import('@/views/promotion/seckill/audit'),
              name: 'MarketingSeckillAudit',
              meta: {
                title: '商品审核',
                parent: '/marketing/promotion/seckill'
              },
              hidden: true
            },
            {
              path: '/marketing/promotion/seckill/stage',
              component: () => import('@/views/promotion/seckill/stage'),
              name: 'MarketingSeckillStage',
              meta: {
                title: '秒杀时段排期',
                parent: '/marketing/promotion/seckill'
              },
              hidden: true
            }
          ]
        },
        {
          path: '/marketing/promotion/timelimit',
          component: ModuleLayout,
          name: 'MarketingTimelimit',
          redirect: '/marketing/promotion/timelimit/index',
          meta: {
            title: '限时折扣'
          },
          hidden: true,
          children: [
            {
              path: '/marketing/promotion/timelimit/index',
              component: () => import('@/views/promotion/timelimit/index'),
              name: 'MarketingTimelimitIndex',
              hidden: true
            },
            {
              path: '/marketing/promotion/timelimit/view/:id',
              component: () => import('@/views/promotion/timelimit/view'),
              name: 'marketing/promotion/timelimit/view/:id',
              meta: {
                title: '活动详情',
                parent: '/marketing/promotion/timelimit'
              },
              hidden: true
            },
            {
              path: '/marketing/promotion/timelimit/audit',
              component: () => import('@/views/promotion/timelimit/audit'),
              name: 'MarketingTimelimitAudit',
              meta: {
                title: '商品审核',
                parent: '/marketing/promotion/timelimit'
              },
              hidden: true
            },
            {
              path: '/marketing/promotion/timelimit/stage',
              component: () => import('@/views/promotion/timelimit/stage'),
              name: 'MarketingTimelimitStage',
              meta: {
                title: '秒杀时段排期',
                parent: '/marketing/promotion/timelimit'
              },
              hidden: true
            }
          ]
        },
        {
          path: '/marketing/promotion/special',
          component: ModuleLayout,
          name: 'MarketingPromotionSpecial',
          redirect: '/marketing/promotion/special/index',
          meta: {
            title: '专题活动',
            icon: 'em-icon-investment'
          },
          hidden: true,
          children: [
            {
              path: '/marketing/promotion/special/index',
              component: () => import('@/views/promotion/special/index'),
              name: 'MarketingActivityIndex',
              hidden: true
            },
            {
              path: '/marketing/promotion/special/update/:id',
              component: () => import('@/views/promotion/special/update'),
              name: 'marketing/activity/update/:id',
              meta: {
                title: '更新'
              },
              hidden: true
            },
            {
              path: '/marketing/promotion/special/product',
              component: () => import('@/views/promotion/special/product'),
              name: 'MarketingActivityProduct',
              meta: {
                title: '商品'
              },
              hidden: true
            }
          ]
        }
      ]
    },
    {
      path: '/marketing/member',
      component: () => import('@/views/marketing/member'),
      name: 'MarketingMember',
      meta: {
        title: '会员营销',
        icon: 'em-icon-role-hex'
      }
    },
    {
      path: '/marketing/coupon',
      component: ModuleLayout,
      redirect: '/marketing/coupon/index',
      name: 'MarketingCoupon',
      meta: {
        title: '卡券中心',
        icon: 'em-icon-coupon'
      },
      children: [
        {
          path: '/marketing/coupon/index',
          component: () => import('@/views/coupon/index'),
          name: 'MarketingCouponIndex',
          meta: {
            title: '列表'
          },
          hidden: true
        },
        {
          path: '/marketing/coupon/update/:id',
          component: () => import('@/views/coupon/update'),
          name: 'marketing/coupon/update/:id',
          meta: {
            title: '更新'
          },
          hidden: true
        },
        {
          path: '/marketing/coupon/view/:id',
          component: () => import('@/views/coupon/view'),
          name: 'marketing/coupon/view/:id',
          meta: {
            title: '查看',
            parent: '/marketing/coupon'
          },
          hidden: true
        },
        {
          path: '/marketing/coupon/give',
          component: () => import('@/views/coupon/give'),
          name: 'MarketingCouponGive',
          meta: {
            title: '发放记录',
            parent: '/marketing/promotion/seckill'
          },
          hidden: true
        },
        {
          path: '/marketing/coupon/use',
          component: () => import('@/views/coupon/use'),
          name: 'MarketingCouponUse',
          meta: {
            title: '使用记录'
            // parent: '/marketing/promotion'
          },
          hidden: true
        }
      ]
    },
    {
      path: '/marketing/tools',
      component: () => import('@/views/marketing/tools'),
      name: 'MarketingTools',
      meta: {
        title: '应用工具',
        icon: 'em-icon-gather'
      }
    }
  ]
}
export default marketingRouter
